<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02作业</title>
</head>
<body>
<div class="root">
    <div>
        <input v-model="name" type="text">
        <input v-model="password" type="password">
        <div v-for="(v,k,i) in array1">账号是{{v.name  |capital}}------- 密码是{{v.passWord}}</div>
        <button @click="show">确认</button>
    </div>
</div>
</body>
</html>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    Vue.filter("capital",function (value) {
return value.slice(0,1).toUpperCase()+value.substring(1);
    });
    new Vue({
        el:".root",
        data:{
            name:"",
            password:"",
            array1:[],
            str:false,
        },
        methods:{
show(){
    this.array1.push({name:this.name,passWord:this.password});

}
        },
    });
</script>